var $Jq=jQuery.noConflict();
(function($){
var methods={
init: function(options){
var o=$.extend({
items: 1,
itemsOnPage: 1,
pages: 0,
displayedPages: 5,
edges: 2,
currentPage: 0,
hrefTextPrefix: '#page-',
hrefTextSuffix: '',
prevText: 'Prev',
nextText: 'Next',
ellipseText: '…',
cssStyle: 'light-theme',
labelMap: [],
selectOnClick: true,
nextAtFront: false,
invertPageOrder: false,
useStartEdge:true,
useEndEdge:true,
onPageClick: function(pageNumber, event){
},
onInit: function(){
}}, options||{});
var self=this;
o.pages=o.pages ? o.pages:Math.ceil(o.items / o.itemsOnPage) ? Math.ceil(o.items / o.itemsOnPage):1;
if(o.currentPage)
o.currentPage=o.currentPage - 1;
else
o.currentPage = !o.invertPageOrder ? 0:o.pages - 1;
o.halfDisplayed=o.displayedPages / 2;
this.each(function(){
self.addClass(o.cssStyle + ' simple-pagination').data('pagination', o);
methods._draw.call(self);
});
o.onInit();
return this;
},
selectPage: function(page){
methods._selectPage.call(this, page - 1);
return this;
},
prevPage: function(){
var o=this.data('pagination');
if(!o.invertPageOrder){
if(o.currentPage > 0){
methods._selectPage.call(this, o.currentPage - 1);
}}else{
if(o.currentPage < o.pages - 1){
methods._selectPage.call(this, o.currentPage + 1);
}}
return this;
},
nextPage: function(){
var o=this.data('pagination');
if(!o.invertPageOrder){
if(o.currentPage < o.pages - 1){
methods._selectPage.call(this, o.currentPage + 1);
}}else{
if(o.currentPage > 0){
methods._selectPage.call(this, o.currentPage - 1);
}}
return this;
},
getPagesCount: function(){
return this.data('pagination').pages;
},
getCurrentPage: function (){
return this.data('pagination').currentPage + 1;
},
destroy: function(){
this.empty();
return this;
},
drawPage: function (page){
var o=this.data('pagination');
o.currentPage=page - 1;
this.data('pagination', o);
methods._draw.call(this);
return this;
},
redraw: function(){
methods._draw.call(this);
return this;
},
disable: function(){
var o=this.data('pagination');
o.disabled=true;
this.data('pagination', o);
methods._draw.call(this);
return this;
},
enable: function(){
var o=this.data('pagination');
o.disabled=false;
this.data('pagination', o);
methods._draw.call(this);
return this;
},
updateItems: function (newItems){
var o=this.data('pagination');
o.items=newItems;
o.pages=methods._getPages(o);
this.data('pagination', o);
methods._draw.call(this);
},
updateItemsOnPage: function (itemsOnPage){
var o=this.data('pagination');
o.itemsOnPage=itemsOnPage;
o.pages=methods._getPages(o);
this.data('pagination', o);
methods._selectPage.call(this, 0);
return this;
},
_draw: function(){
var o=this.data('pagination'),
interval=methods._getInterval(o),
i,
tagName;
methods.destroy.call(this);
tagName=(typeof this.prop==='function') ? this.prop('tagName'):this.attr('tagName');
var $panel=tagName==='UL' ? this:$('
').appendTo(this);
if(o.prevText){
methods._appendItem.call(this, !o.invertPageOrder ? o.currentPage - 1:o.currentPage + 1, {text: o.prevText, classes: 'prev'});
}
if(o.nextText&&o.nextAtFront){
methods._appendItem.call(this, !o.invertPageOrder ? o.currentPage + 1:o.currentPage - 1, {text: o.nextText, classes: 'next'});
}
if(!o.invertPageOrder){
if(interval.start > 0&&o.edges > 0){
if(o.useStartEdge){
var end=Math.min(o.edges, interval.start);
for (i=0; i < end; i++){
methods._appendItem.call(this, i);
}}
if(o.edges < interval.start&&(interval.start - o.edges!=1)){
$panel.append('' + o.ellipseText + '');
}else if(interval.start - o.edges==1){
methods._appendItem.call(this, o.edges);
}}
}else{
if(interval.end < o.pages&&o.edges > 0){
if(o.useStartEdge){
var begin=Math.max(o.pages - o.edges, interval.end);
for (i=o.pages - 1; i >=begin; i--){
methods._appendItem.call(this, i);
}}
if(o.pages - o.edges > interval.end&&(o.pages - o.edges - interval.end!=1)){
$panel.append('' + o.ellipseText + '');
}else if(o.pages - o.edges - interval.end==1){
methods._appendItem.call(this, interval.end);
}}
}
if(!o.invertPageOrder){
for (i=interval.start; i < interval.end; i++){
methods._appendItem.call(this, i);
}}else{
for (i=interval.end - 1; i >=interval.start; i--){
methods._appendItem.call(this, i);
}}
if(!o.invertPageOrder){
if(interval.end < o.pages&&o.edges > 0){
if(o.pages - o.edges > interval.end&&(o.pages - o.edges - interval.end!=1)){
$panel.append('' + o.ellipseText + '');
}else if(o.pages - o.edges - interval.end==1){
methods._appendItem.call(this, interval.end);
}
if(o.useEndEdge){
var begin=Math.max(o.pages - o.edges, interval.end);
for (i=begin; i < o.pages; i++){
methods._appendItem.call(this, i);
}}
}}else{
if(interval.start > 0&&o.edges > 0){
if(o.edges < interval.start&&(interval.start - o.edges!=1)){
$panel.append('' + o.ellipseText + '');
}else if(interval.start - o.edges==1){
methods._appendItem.call(this, o.edges);
}
if(o.useEndEdge){
var end=Math.min(o.edges, interval.start);
for (i=end - 1; i >=0; i--){
methods._appendItem.call(this, i);
}}
}}
if(o.nextText&&!o.nextAtFront){
methods._appendItem.call(this, !o.invertPageOrder ? o.currentPage + 1:o.currentPage - 1, {text: o.nextText, classes: 'next'});
}},
_getPages: function(o){
var pages=Math.ceil(o.items / o.itemsOnPage);
return pages||1;
},
_getInterval: function(o){
return {
start: Math.ceil(o.currentPage > o.halfDisplayed ? Math.max(Math.min(o.currentPage - o.halfDisplayed, (o.pages - o.displayedPages)), 0):0),
end: Math.ceil(o.currentPage > o.halfDisplayed ? Math.min(o.currentPage + o.halfDisplayed, o.pages):Math.min(o.displayedPages, o.pages))
};},
_appendItem: function(pageIndex, opts){
var self=this, options, $link, o=self.data('pagination'), $linkWrapper=$(''), $ul=self.find('ul');
pageIndex=pageIndex < 0 ? 0:(pageIndex < o.pages ? pageIndex:o.pages - 1);
options={
text: pageIndex + 1,
classes: ''
};
if(o.labelMap.length&&o.labelMap[pageIndex]){
options.text=o.labelMap[pageIndex];
}
options=$.extend(options, opts||{});
if(pageIndex==o.currentPage||o.disabled){
if(o.disabled){
$linkWrapper.addClass('disabled');
}else{
$linkWrapper.addClass('active');
}
$link=$('' + (options.text) + '');
}else{
$link=$('' + (options.text) + '');
$link.click(function(event){
return methods._selectPage.call(self, pageIndex, event);
});
}
if(options.classes){
$link.addClass(options.classes);
}
$linkWrapper.append($link);
if($ul.length){
$ul.append($linkWrapper);
}else{
self.append($linkWrapper);
}},
_selectPage: function(pageIndex, event){
var o=this.data('pagination');
o.currentPage=pageIndex;
if(o.selectOnClick){
methods._draw.call(this);
}
return o.onPageClick(pageIndex + 1, event);
}};
$.fn.pagination=function(method){
if(methods[method]&&method.charAt(0)!='_'){
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
}else if(typeof method==='object'||!method){
return methods.init.apply(this, arguments);
}else{
$.error('Method ' + method + ' does not exist on jQuery.pagination');
}};})(jQuery);
(function($Jq){
$Jq.extend($Jq.fn, {
validate: function(options){
if(!this.length){
options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");
return;
}
var validator=$Jq.data(this[0], 'validator');
if(validator){
return validator;
}
validator=new $Jq.validator(options, this[0]);
$Jq.data(this[0], 'validator', validator);
if(validator.settings.onsubmit){
this.find("input, button").filter(".cancel").click(function(){
validator.cancelSubmit=true;
});
if(validator.settings.submitHandler){
this.find("input, button").filter(":submit").click(function(){
validator.submitButton=this;
});
}
this.submit(function(event){
if(validator.settings.debug)
event.preventDefault();
function handle(){
if(validator.settings.submitHandler){
if(validator.submitButton){
var hidden=$Jq("").attr("name", validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm);
}
validator.settings.submitHandler.call(validator, validator.currentForm);
if(validator.submitButton){
hidden.remove();
}
return false;
}
return true;
}
if(validator.cancelSubmit){
validator.cancelSubmit=false;
return handle();
}
if(validator.form()){
if(validator.pendingRequest){
validator.formSubmitted=true;
return false;
}
return handle();
}else{
validator.focusInvalid();
return false;
}});
}
return validator;
},
valid: function(){
if($Jq(this[0]).is('form')){
return this.validate().form();
}else{
var valid=true;
var validator=$Jq(this[0].form).validate();
this.each(function(){
valid &=validator.element(this);
});
return valid;
}},
removeAttrs: function(attributes){
var result={},
$Jqelement=this;
$Jq.each(attributes.split(/\s/), function(index, value){
result[value]=$Jqelement.attr(value);
$Jqelement.removeAttr(value);
});
return result;
},
rules: function(command, argument){
var element=this[0];
if(command){
var settings=$Jq.data(element.form, 'validator').settings;
var staticRules=settings.rules;
var existingRules=$Jq.validator.staticRules(element);
switch(command){
case "add":
$Jq.extend(existingRules, $Jq.validator.normalizeRule(argument));
staticRules[element.name]=existingRules;
if(argument.messages)
settings.messages[element.name]=$Jq.extend(settings.messages[element.name], argument.messages);
break;
case "remove":
if(!argument){
delete staticRules[element.name];
return existingRules;
}
var filtered={};
$Jq.each(argument.split(/\s/), function(index, method){
filtered[method]=existingRules[method];
delete existingRules[method];
});
return filtered;
}}
var data=$Jq.validator.normalizeRules($Jq.extend({},
$Jq.validator.metadataRules(element),
$Jq.validator.classRules(element),
$Jq.validator.attributeRules(element),
$Jq.validator.staticRules(element)
), element);
if(data.required){
var param=data.required;
delete data.required;
data=$Jq.extend({required: param}, data);
}
return data;
}});
$Jq.extend($Jq.expr[":"], {
blank: function(a){return !$Jq.trim("" + a.value);},
filled: function(a){return !!$Jq.trim("" + a.value);},
unchecked: function(a){return !a.checked;}});
$Jq.validator=function(options, form){
this.settings=$Jq.extend(true, {}, $Jq.validator.defaults, options);
this.currentForm=form;
this.init();
};
$Jq.validator.format=function(source, params){
if(arguments.length==1)
return function(){
var args=$Jq.makeArray(arguments);
args.unshift(source);
return $Jq.validator.format.apply(this, args);
};
if(arguments.length > 2&¶ms.constructor!=Array){
params=$Jq.makeArray(arguments).slice(1);
}
if(params.constructor!=Array){
params=[ params ];
}
$Jq.each(params, function(i, n){
source=source.replace(new RegExp("\\{" + i + "\\}", "g"), n);
});
return source;
};
$Jq.extend($Jq.validator, {
defaults: {
messages: {},
groups: {},
rules: {},
errorClass: "error",
validClass: "valid",
errorElement: "label",
focusInvalid: true,
errorContainer: $Jq([]),
errorLabelContainer: $Jq([]),
onsubmit: true,
ignore: [],
ignoreTitle: false,
onfocusin: function(element){
this.lastActive=element;
if(this.settings.focusCleanup&&!this.blockFocusCleanup){
this.settings.unhighlight&&this.settings.unhighlight.call(this, element, this.settings.errorClass, this.settings.validClass);
this.errorsFor(element).hide();
}},
/*onfocusout: function(element){
if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){
this.element(element);
}},*/
onkeyup: function(element){
if(element.name in this.submitted||element==this.lastElement){
this.element(element);
}},
onclick: function(element){
if(element.name in this.submitted)
this.element(element);
else if(element.parentNode.name in this.submitted)
this.element(element.parentNode);
},
highlight: function(element, errorClass, validClass){
$Jq(element).addClass(errorClass).removeClass(validClass);
},
unhighlight: function(element, errorClass, validClass){
$Jq(element).removeClass(errorClass).addClass(validClass);
}},
setDefaults: function(settings){
$Jq.extend($Jq.validator.defaults, settings);
},
messages: {
required: "This field is required.",
remote: "Please fix this field.",
email: "Please enter a valid email address.",
url: "Please enter a valid URL.",
date: "Please enter a valid date.",
dateISO: "Please enter a valid date (ISO).",
number: "Please enter a valid number.",
digits: "Please enter only digits.",
creditcard: "Please enter a valid credit card number.",
equalTo: "Please enter the same value again.",
accept: "Please enter a value with a valid extension.",
maxlength: $Jq.validator.format("Please enter no more than {0} characters."),
minlength: $Jq.validator.format("Please enter at least {0} characters."),
rangelength: $Jq.validator.format("Please enter a value between {0} and {1} characters long."),
range: $Jq.validator.format("Please enter a value between {0} and {1}."),
max: $Jq.validator.format("Please enter a value less than or equal to {0}."),
min: $Jq.validator.format("Please enter a value greater than or equal to {0}.")
},
autoCreateRanges: false,
prototype: {
init: function(){
this.labelContainer=$Jq(this.settings.errorLabelContainer);
this.errorContext=this.labelContainer.length&&this.labelContainer||$Jq(this.currentForm);
this.containers=$Jq(this.settings.errorContainer).add(this.settings.errorLabelContainer);
this.submitted={};
this.valueCache={};
this.pendingRequest=0;
this.pending={};
this.invalid={};
this.reset();
var groups=(this.groups={});
$Jq.each(this.settings.groups, function(key, value){
$Jq.each(value.split(/\s/), function(index, name){
groups[name]=key;
});
});
var rules=this.settings.rules;
$Jq.each(rules, function(key, value){
rules[key]=$Jq.validator.normalizeRule(value);
});
function delegate(event){
var validator=$Jq.data(this[0].form, "validator"),
eventType="on" + event.type.replace(/^validate/, "");
validator.settings[eventType]&&validator.settings[eventType].call(validator, this[0]);
}
$Jq(this.currentForm)
.validateDelegate(":text, :password, :file, select, textarea", "focusin focusout keyup", delegate)
.validateDelegate(":radio, :checkbox, select, option", "click", delegate);
if(this.settings.invalidHandler)
$Jq(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler);
},
form: function(){
this.checkForm();
$Jq.extend(this.submitted, this.errorMap);
this.invalid=$Jq.extend({}, this.errorMap);
if(!this.valid())
$Jq(this.currentForm).triggerHandler("invalid-form", [this]);
this.showErrors();
return this.valid();
},
checkForm: function(){
this.prepareForm();
for(var i=0, elements=(this.currentElements=this.elements()); elements[i]; i++){
this.check(elements[i]);
}
return this.valid();
},
element: function(element){
element=this.clean(element);
this.lastElement=element;
this.prepareElement(element);
this.currentElements=$Jq(element);
var result=this.check(element);
if(result){
delete this.invalid[element.name];
}else{
this.invalid[element.name]=true;
}
if(!this.numberOfInvalids()){
this.toHide=this.toHide.add(this.containers);
}
this.showErrors();
return result;
},
showErrors: function(errors){
if(errors){
$Jq.extend(this.errorMap, errors);
this.errorList=[];
for(var name in errors){
this.errorList.push({
message: errors[name],
element: this.findByName(name)[0]
});
}
this.successList=$Jq.grep(this.successList, function(element){
return !(element.name in errors);
});
}
this.settings.showErrors
? this.settings.showErrors.call(this, this.errorMap, this.errorList)
: this.defaultShowErrors();
},
resetForm: function(){
if($Jq.fn.resetForm)
$Jq(this.currentForm).resetForm();
this.submitted={};
this.prepareForm();
this.hideErrors();
this.elements().removeClass(this.settings.errorClass);
},
numberOfInvalids: function(){
return this.objectLength(this.invalid);
},
objectLength: function(obj){
var count=0;
for(var i in obj)
count++;
return count;
},
hideErrors: function(){
this.addWrapper(this.toHide).hide();
},
valid: function(){
return this.size()==0;
},
size: function(){
return this.errorList.length;
},
focusInvalid: function(){
if(this.settings.focusInvalid){
try {
$Jq(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[])
.filter(":visible")
.focus()
.trigger("focusin");
} catch(e){
}}
},
findLastActive: function(){
var lastActive=this.lastActive;
return lastActive&&$Jq.grep(this.errorList, function(n){
return n.element.name==lastActive.name;
}).length==1&&lastActive;
},
elements: function(){
var validator=this,
rulesCache={};
return $Jq([]).add(this.currentForm.elements)
.filter(":input")
.not(":submit, :reset, :image, [disabled]")
.not(this.settings.ignore)
.filter(function(){
!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned", this);
if(this.name in rulesCache||!validator.objectLength($Jq(this).rules()))
return false;
rulesCache[this.name]=true;
return true;
});
},
clean: function(selector){
return $Jq(selector)[0];
},
errors: function(){
return $Jq(this.settings.errorElement + "." + this.settings.errorClass, this.errorContext);
},
reset: function(){
this.successList=[];
this.errorList=[];
this.errorMap={};
this.toShow=$Jq([]);
this.toHide=$Jq([]);
this.currentElements=$Jq([]);
},
prepareForm: function(){
this.reset();
this.toHide=this.errors().add(this.containers);
},
prepareElement: function(element){
this.reset();
this.toHide=this.errorsFor(element);
},
check: function(element){
element=this.clean(element);
if(this.checkable(element)){
element=this.findByName(element.name)[0];
}
var rules=$Jq(element).rules();
var dependencyMismatch=false;
for(method in rules){
var rule={ method: method, parameters: rules[method] };
try {
var result=$Jq.validator.methods[method].call(this, element.value.replace(/\r/g, ""), element, rule.parameters);
if(result=="dependency-mismatch"){
dependencyMismatch=true;
continue;
}
dependencyMismatch=false;
if(result=="pending"){
this.toHide=this.toHide.not(this.errorsFor(element));
return;
}
if(!result){
this.formatAndAdd(element, rule);
return false;
}} catch(e){
this.settings.debug&&window.console&&console.log("exception occured when checking element " + element.id
+ ", check the '" + rule.method + "' method", e);
throw e;
}}
if(dependencyMismatch)
return;
if(this.objectLength(rules))
this.successList.push(element);
return true;
},
customMetaMessage: function(element, method){
if(!$Jq.metadata)
return;
var meta=this.settings.meta
? $Jq(element).metadata()[this.settings.meta]
: $Jq(element).metadata();
return meta&&meta.messages&&meta.messages[method];
},
customMessage: function(name, method){
var m=this.settings.messages[name];
return m&&(m.constructor==String
? m
: m[method]);
},
findDefined: function(){
for(var i=0; i < arguments.length; i++){
if(arguments[i]!==undefined)
return arguments[i];
}
return undefined;
},
defaultMessage: function(element, method){
return this.findDefined(this.customMessage(element.name, method),
this.customMetaMessage(element, method),
!this.settings.ignoreTitle&&element.title||undefined,
$Jq.validator.messages[method],
"Warning: No message defined for " + element.name + ""
);
},
formatAndAdd: function(element, rule){
var message=this.defaultMessage(element, rule.method),
theregex=/\$?\{(\d+)\}/g;
if(typeof message=="function"){
message=message.call(this, rule.parameters, element);
}else if(theregex.test(message)){
message=jQuery.format(message.replace(theregex, '{$1}'), rule.parameters);
}
this.errorList.push({
message: message,
element: element
});
this.errorMap[element.name]=message;
this.submitted[element.name]=message;
},
addWrapper: function(toToggle){
if(this.settings.wrapper)
toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));
return toToggle;
},
defaultShowErrors: function(){
for(var i=0; this.errorList[i]; i++){
var error=this.errorList[i];
this.settings.highlight&&this.settings.highlight.call(this, error.element, this.settings.errorClass, this.settings.validClass);
this.showLabel(error.element, error.message);
}
if(this.errorList.length){
this.toShow=this.toShow.add(this.containers);
}
if(this.settings.success){
for(var i=0; this.successList[i]; i++){
this.showLabel(this.successList[i]);
}}
if(this.settings.unhighlight){
for(var i=0, elements=this.validElements(); elements[i]; i++){
this.settings.unhighlight.call(this, elements[i], this.settings.errorClass, this.settings.validClass);
}}
this.toHide=this.toHide.not(this.toShow);
this.hideErrors();
this.addWrapper(this.toShow).show();
},
validElements: function(){
return this.currentElements.not(this.invalidElements());
},
invalidElements: function(){
return $Jq(this.errorList).map(function(){
return this.element;
});
},
showLabel: function(element, message){
var label=this.errorsFor(element);
if(label.length){
label.removeClass().addClass(this.settings.errorClass);
label.attr("generated")&&label.html(message);
}else{
label=$Jq("<" + this.settings.errorElement + "/>")
.attr({"for": this.idOrName(element), generated: true})
.addClass(this.settings.errorClass)
.html(message||"");
if(this.settings.wrapper){
label=label.hide().show().wrap("<" + this.settings.wrapper + "/>").parent();
}
if(!this.labelContainer.append(label).length)
this.settings.errorPlacement
? this.settings.errorPlacement(label, $Jq(element))
: label.insertAfter(element);
}
if(!message&&this.settings.success){
label.text("");
typeof this.settings.success=="string"
? label.addClass(this.settings.success)
: this.settings.success(label);
}
this.toShow=this.toShow.add(label);
},
errorsFor: function(element){
var name=this.idOrName(element);
return this.errors().filter(function(){
return $Jq(this).attr('for')==name;
});
},
idOrName: function(element){
return this.groups[element.name]||(this.checkable(element) ? element.name:element.id||element.name);
},
checkable: function(element){
return /radio|checkbox/i.test(element.type);
},
findByName: function(name){
var form=this.currentForm;
return $Jq(document.getElementsByName(name)).map(function(index, element){
return element.form==form&&element.name==name&&element||null;
});
},
getLength: function(value, element){
switch(element.nodeName.toLowerCase()){
case 'select':
return $Jq("option:selected", element).length;
case 'input':
if(this.checkable(element))
return this.findByName(element.name).filter(':checked').length;
}
return value.length;
},
depend: function(param, element){
return this.dependTypes[typeof param]
? this.dependTypes[typeof param](param, element)
: true;
},
dependTypes: {
"boolean": function(param, element){
return param;
},
"string": function(param, element){
return !!$Jq(param, element.form).length;
},
"function": function(param, element){
return param(element);
}},
optional: function(element){
return !$Jq.validator.methods.required.call(this, $Jq.trim(element.value), element)&&"dependency-mismatch";
},
startRequest: function(element){
if(!this.pending[element.name]){
this.pendingRequest++;
this.pending[element.name]=true;
}},
stopRequest: function(element, valid){
this.pendingRequest--;
if(this.pendingRequest < 0)
this.pendingRequest=0;
delete this.pending[element.name];
if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){
$Jq(this.currentForm).submit();
this.formSubmitted=false;
}else if(!valid&&this.pendingRequest==0&&this.formSubmitted){
$Jq(this.currentForm).triggerHandler("invalid-form", [this]);
this.formSubmitted=false;
}},
previousValue: function(element){
return $Jq.data(element, "previousValue")||$Jq.data(element, "previousValue", {
old: null,
valid: true,
message: this.defaultMessage(element, "remote")
});
}},
classRuleSettings: {
required: {required: true},
email: {email: true},
url: {url: true},
date: {date: true},
dateISO: {dateISO: true},
dateDE: {dateDE: true},
number: {number: true},
numberDE: {numberDE: true},
digits: {digits: true},
creditcard: {creditcard: true}},
addClassRules: function(className, rules){
className.constructor==String ?
this.classRuleSettings[className]=rules :
$Jq.extend(this.classRuleSettings, className);
},
classRules: function(element){
var rules={};
var classes=$Jq(element).attr('class');
classes&&$Jq.each(classes.split(' '), function(){
if(this in $Jq.validator.classRuleSettings){
$Jq.extend(rules, $Jq.validator.classRuleSettings[this]);
}});
return rules;
},
attributeRules: function(element){
var rules={};
var $Jqelement=$Jq(element);
for (method in $Jq.validator.methods){
var value=$Jqelement.attr(method);
if(value){
rules[method]=value;
}}
if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){
delete rules.maxlength;
}
return rules;
},
metadataRules: function(element){
if(!$Jq.metadata) return {};
var meta=$Jq.data(element.form, 'validator').settings.meta;
return meta ?
$Jq(element).metadata()[meta] :
$Jq(element).metadata();
},
staticRules: function(element){
var rules={};
var validator=$Jq.data(element.form, 'validator');
if(validator.settings.rules){
rules=$Jq.validator.normalizeRule(validator.settings.rules[element.name])||{};}
return rules;
},
normalizeRules: function(rules, element){
$Jq.each(rules, function(prop, val){
if(val===false){
delete rules[prop];
return;
}
if(val.param||val.depends){
var keepRule=true;
switch (typeof val.depends){
case "string":
keepRule = !!$Jq(val.depends, element.form).length;
break;
case "function":
keepRule=val.depends.call(element, element);
break;
}
if(keepRule){
rules[prop]=val.param!==undefined ? val.param:true;
}else{
delete rules[prop];
}}
});
$Jq.each(rules, function(rule, parameter){
rules[rule]=$Jq.isFunction(parameter) ? parameter(element):parameter;
});
$Jq.each(['minlength', 'maxlength', 'min', 'max'], function(){
if(rules[this]){
rules[this]=Number(rules[this]);
}});
$Jq.each(['rangelength', 'range'], function(){
if(rules[this]){
rules[this]=[Number(rules[this][0]), Number(rules[this][1])];
}});
if($Jq.validator.autoCreateRanges){
if(rules.min&&rules.max){
rules.range=[rules.min, rules.max];
delete rules.min;
delete rules.max;
}
if(rules.minlength&&rules.maxlength){
rules.rangelength=[rules.minlength, rules.maxlength];
delete rules.minlength;
delete rules.maxlength;
}}
if(rules.messages){
delete rules.messages;
}
return rules;
},
normalizeRule: function(data){
if(typeof data=="string"){
var transformed={};
$Jq.each(data.split(/\s/), function(){
transformed[this]=true;
});
data=transformed;
}
return data;
},
addMethod: function(name, method, message){
$Jq.validator.methods[name]=method;
$Jq.validator.messages[name]=message!=undefined ? message:$Jq.validator.messages[name];
if(method.length < 3){
$Jq.validator.addClassRules(name, $Jq.validator.normalizeRule(name));
}},
methods: {
required: function(value, element, param){
if(!this.depend(param, element))
return "dependency-mismatch";
switch(element.nodeName.toLowerCase()){
case 'select':
var val=$Jq(element).val();
return val&&val.length > 0;
case 'input':
if(this.checkable(element))
return this.getLength(value, element) > 0;
default:
return $Jq.trim(value).length > 0;
}},
remote: function(value, element, param){
if(this.optional(element))
return "dependency-mismatch";
var previous=this.previousValue(element);
if(!this.settings.messages[element.name])
this.settings.messages[element.name]={};
previous.originalMessage=this.settings.messages[element.name].remote;
this.settings.messages[element.name].remote=previous.message;
param=typeof param=="string"&&{url:param}||param;
if(previous.old!==value){
previous.old=value;
var validator=this;
this.startRequest(element);
var data={};
data[element.name]=value;
$Jq.ajax($Jq.extend(true, {
url: param,
mode: "abort",
port: "validate" + element.name,
dataType: "json",
data: data,
success: function(response){
validator.settings.messages[element.name].remote=previous.originalMessage;
var valid=response===true;
if(valid){
var submitted=validator.formSubmitted;
validator.prepareElement(element);
validator.formSubmitted=submitted;
validator.successList.push(element);
validator.showErrors();
}else{
var errors={};
var message=(previous.message=response||validator.defaultMessage(element, "remote"));
errors[element.name]=$Jq.isFunction(message) ? message(value):message;
validator.showErrors(errors);
}
previous.valid=valid;
validator.stopRequest(element, valid);
}}, param));
return "pending";
}else if(this.pending[element.name]){
return "pending";
}
return previous.valid;
},
minlength: function(value, element, param){
return this.optional(element)||this.getLength($Jq.trim(value), element) >=param;
},
maxlength: function(value, element, param){
return this.optional(element)||this.getLength($Jq.trim(value), element) <=param;
},
rangelength: function(value, element, param){
var length=this.getLength($Jq.trim(value), element);
return this.optional(element)||(length >=param[0]&&length <=param[1]);
},
min: function(value, element, param){
return this.optional(element)||value >=param;
},
max: function(value, element, param){
return this.optional(element)||value <=param;
},
range: function(value, element, param){
return this.optional(element)||(value >=param[0]&&value <=param[1]);
},
email: function(value, element){
return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);
},
url: function(value, element){
return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);
},
date: function(value, element){
return this.optional(element)||!/Invalid|NaN/.test(new Date(value));
},
dateISO: function(value, element){
return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);
},
number: function(value, element){
return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);
},
digits: function(value, element){
return this.optional(element)||/^\d+$/.test(value);
},
creditcard: function(value, element){
if(this.optional(element))
return "dependency-mismatch";
if(/[^0-9-]+/.test(value))
return false;
var nCheck=0,
nDigit=0,
bEven=false;
value=value.replace(/\D/g, "");
for (var n=value.length - 1; n >=0; n--){
var cDigit=value.charAt(n);
var nDigit=parseInt(cDigit, 10);
if(bEven){
if((nDigit *=2) > 9)
nDigit -=9;
}
nCheck +=nDigit;
bEven = !bEven;
}
return (nCheck % 10)==0;
},
accept: function(value, element, param){
param=typeof param=="string" ? param.replace(/,/g, '|'):"png|jpe?g|gif";
return this.optional(element)||value.match(new RegExp(".(" + param + ")$", "i"));
},
equalTo: function(value, element, param){
var target=$Jq(param).unbind(".validate-equalTo").bind("blur.validate-equalTo", function(){
$Jq(element).valid();
});
return value==target.val();
}}
});
$Jq.format=$Jq.validator.format;
})(jQuery);
;(function($Jq){
var ajax=$Jq.ajax;
var pendingRequests={};
$Jq.ajax=function(settings){
settings=$Jq.extend(settings, $Jq.extend({}, $Jq.ajaxSettings, settings));
var port=settings.port;
if(settings.mode=="abort"){
if(pendingRequests[port]){
pendingRequests[port].abort();
}
return (pendingRequests[port]=ajax.apply(this, arguments));
}
return ajax.apply(this, arguments);
};})(jQuery);
;(function($Jq){
if(!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener){
$Jq.each({
focus: 'focusin',
blur: 'focusout'
}, function(original, fix){
$Jq.event.special[fix]={
setup:function(){
this.addEventListener(original, handler, true);
},
teardown:function(){
this.removeEventListener(original, handler, true);
},
handler: function(e){
arguments[0]=$Jq.event.fix(e);
arguments[0].type=fix;
return $Jq.event.handle.apply(this, arguments);
}};
function handler(e){
e=$Jq.event.fix(e);
e.type=fix;
return $Jq.event.handle.call(this, e);
}});
};
$Jq.extend($Jq.fn, {
validateDelegate: function(delegate, type, handler){
return this.bind(type, function(event){
var target=$Jq(event.target);
if(target.is(delegate)){
return handler.apply(target, arguments);
}});
}});
})(jQuery);
var IGlobal={
init:function(){
$Jq('#ipray-share-button').click(function(e){
if($Jq('#ipray-prayers-container').css('display')=='block'){
$Jq(this).text($Jq(this).data('open'));
$Jq(this).removeClass('open');
$Jq('#ipray-prayers-container,#newsletter-container').hide();
}else{
if($Jq('#newsletter-container').css('display')=='block'){
$Jq('#ipray-subscribe-button').trigger("click");
}
$Jq('#ipray-notifications').removeAttr('class').html('');
$Jq(this).text($Jq(this).data('close'));
$Jq(this).addClass('open');
$Jq('#ipray-prayers-container').show();
}});
$Jq('#ipray-subscribe-button').click(function(e){
if($Jq('#newsletter-container').css('display')=='block'){
$Jq(this).text($Jq(this).data('open'));
$Jq(this).removeClass('open');
$Jq('#newsletter-container,#ipray-prayers-container').hide();
}else{
if($Jq('#ipray-prayers-container').css('display')=='block'){
$Jq('#ipray-share-button').trigger("click");
}
$Jq('#ipray-notifications').removeAttr('class').html('');
$Jq(this).text($Jq(this).data('close'));
$Jq(this).addClass('open');
$Jq('#newsletter-container').show();
}});
$Jq('body').on("click", ".ipray-submitlink", function(e){
if($Jq(this).hasClass('active')){
IGlobal.iPrayed($Jq(this));
}});
IGlobal.PrayerList($Jq('.ipray-main-container'), $Jq('form#ipraylistHiddenForm'));
$Jq("#ipray-newsletter-form").validate({
rules: {
email: {
required: true,
email: true,
}},
messages: {
},
submitHandler: function(form){
IGlobal.formNewsLetterSubmit(form);
}});
$Jq("#ipray-prayer-submit-form").validate({
rules: {
name: "required",
desired_share_option: "required",
prayer: "required",
email: {
required: true,
email: true
}},
submitHandler: function(form){
IGlobal.formPrayerSubmit(form);
}});
},
search:{
action: null,
params:{},
draw_pagination:true,
sDiv: null,
sFrm: null,
sBlockType: 'item',
sResultDiv: null,
},
iPrayed: function(obj){
if(obj.hasClass('locked')){
return ;
}
var link_text=obj.text();
obj.text($Jq('#ipray-notifications').data('sending-text'));
obj.addClass('locked');
$thisInst=this;
$Jq.ajax({
type: "POST",
url: $thisInst.search.action,
data: {prayer_id:obj.data('id'),requesturi:$Jq('#ipray-notifications').data('requesturi'),action:'iprayed'},
dataType: 'json',
success: function(data, textStatus){
if(data.prayer_count){
obj.siblings('.prayer_count').text(data.prayer_count_msg);
obj.removeClass('active').addClass('deactive');
obj.removeClass('locked');
obj.text(link_text);
}},
error: function(errorObj, textStatus, errorThrown){
$Jq('#ipray-notifications').html($Jq('#ipray-notifications').data('error-msg'));
}});
},
formNewsLetterSubmit: function(d){
$thisInst=this;
var submit_val=$Jq(d).find("input[type=submit]").val();
$Jq(d).find("input[type=submit]").val($Jq('#ipray-notifications').data('sending-text'));
$Jq.ajax({
type: "POST",
url: $thisInst.search.action,
data: $Jq(d).serialize(),
dataType: 'json',
success: function(data, textStatus){
if(data.submit){
$Jq(d).find("input[type=submit]").val(submit_val);
if(data.submit==2){
$Jq('#ipray-notifications').addClass('error').html(data.msg);
}else{
$Jq(d).parent().hide();
$Jq(d).find("input[type=text]").val("");
$Jq('#ipray-notifications').addClass('success').html(data.msg);
$Jq('#ipray-subscribe-button').text($Jq('#ipray-subscribe-button').data('open'));
}}else{
$Jq('#ipray-notifications').addClass('error').html($Jq('#ipray-notifications').data('error-msg'));
}},
error: function(errorObj, textStatus, errorThrown){
$Jq('#ipray-notifications').html($Jq('#ipray-notifications').data('error-msg'));
}});
},
formPrayerSubmit: function(d){
$thisInst=this;
var submit_val=$Jq(d).find("input[type=submit]").val();
$Jq(d).find("input[type=submit]").val($Jq('#ipray-notifications').data('sending-text'));
$Jq.ajax({
type: "POST",
url: $thisInst.search.action,
data: $Jq(d).serialize(),
dataType: 'json',
success: function(data, textStatus){
$Jq(d).find("input[type=submit]").val(submit_val);
if(data.submit){
$Jq(d).parent().hide();
$Jq(d).find("input[type=text], textarea").val("");
$Jq('#ipray-notifications').html($Jq('#notification').data('success-msg'));
$Jq('#ipray-share-button').text($Jq('#ipray-share-button').data('open'));
IGlobal.PrayerList($Jq('.ipray-main-container'), $Jq('form#ipraylistHiddenForm'));
}else{
$Jq('#ipray-notifications').html($Jq('#ipray-notifications').data('error-msg'));
}},
error: function(errorObj, textStatus, errorThrown){
$Jq('#ipray-notifications').html($Jq('#ipray-notifications').data('error-msg'));
}});
},
ajaxListData: function(){
$thisInst=this;
$thisInst.search.sDiv.find('.ipray-loading').show();
var searchPg=$thisInst.search.sDiv.find('.ipray-results-page');
searchPg=$thisInst.search.sResultDiv||searchPg;
searchPg.html('');
$Jq.ajax({
type: "POST",
url: $thisInst.search.action,
data: $thisInst.search.sFrm.serialize(),
dataType: 'json',
success: function(data, textStatus){
$thisInst.search.sDiv.find('.ipray-loading').hide();
if(data.res_count > 0){
$Jq.each(data.display_results, function(k, v){
searchPg.append(IGlobal.prayerListTemplate(v,data.setting));
});
if($thisInst.search.draw_pagination){
allowForOne=Math.ceil(data.res_count/data.per_page);
if(allowForOne!==0&&allowForOne >1){
$thisInst.draw_pagination(data.res_count, data.per_page);
}}
}else{
searchPg.html(''+ searchPg.attr('data-msg-data-not-found') +'
');
$Jq('.ipray-results-pagination').html('');
}},
error: function(errorObj, textStatus, errorThrown){
$thisInst.search.sDiv.find('.iprayloading').hide();
searchPg.html(''+ searchPg.attr('data-msg-data-not-found') +'
');
$Jq('.ipray-results-pagination').html('');
}});
},
draw_pagination: function(total_result, show_per_page){
$thisInst=this;
$Jq('.ipray-results-pagination').pagination({
items: total_result,
itemsOnPage: show_per_page,
currentPage: 1,
onPageClick: function(p, e){
e.preventDefault();
var start=parseInt(show_per_page*(p-1));
$thisInst.search.sFrm.find('input[name="start"]').val(start);
$thisInst.search.draw_pagination=false;
$Jq("html, body").animate({scrollTop:0}, 1300);
$thisInst.ajaxListData();
}});
},
PrayerList: function(d, f){
$thisInst=this;
$thisInst.search.action=f.attr('action');
$thisInst.search.sDiv=d;
$thisInst.search.sFrm=f;
$thisInst.ajaxListData();
},
prayerListTemplate: function(d,setting){
h='';
h +='
';
h +='
';
h +=setting.prayer_text+'';
h +='
';
if(d.prayer_count!=0){
h +=d.prayer_count_msg;
}
h +='';
h +='
';
h +='
'+d.name+'
';
h +='
'+d.prayer+'
';
h +='
'+setting.recieve_text+''+d.date_time+'';
h +='
';
return h;
},
};
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?a<0?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;d0&&b-1 in a)}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=fa(),z=fa(),A=fa(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;c+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(xa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ea(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+pa(r[h]);s=r.join(","),w=_.test(a)&&na(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function fa(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ga(a){return a[u]=!0,a}function ha(a){var b=n.createElement("div");try{return!!a(b)}catch(xa){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ia(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ja(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ka(a){return function(b){return"input"===b.nodeName.toLowerCase()&&b.type===a}}function la(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function ma(a){return ga(function(b){return b=+b,ga(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function na(a){return a&&void 0!==a.getElementsByTagName&&a}c=ea.support={},f=ea.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ea.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ha(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ha(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ha(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(void 0!==b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c=void 0!==a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return void 0!==b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if(void 0!==b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ha(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ha(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ha(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d||(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ja(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ja(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ea.matches=function(a,b){return ea(a,null,null,b)},ea.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(xa){}return ea(b,n,null,[a]).length>0},ea.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ea.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ea.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ea.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ea.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ea.selectors={cacheLength:50,createPseudo:ga,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ea.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ea.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||void 0!==a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ea.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),!1===t)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return(t-=e)===d||t%d==0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ea.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ga(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ga(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ga(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ga(function(a){return function(b){return ea(a,b).length>0}}),contains:ga(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ga(function(a){return V.test(a||"")||ea.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do{if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return(c=c.toLowerCase())===a||0===c.indexOf(a+"-")}while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return!1===a.disabled},disabled:function(a){return!0===a.disabled},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,!0===a.selected},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:ma(function(){return[0]}),last:ma(function(a,b){return[b-1]}),eq:ma(function(a,b,c){return[c<0?c+b:c]}),even:ma(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:ma(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sa(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=ta(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function va(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=qa(function(a){return a===b},h,!0),l=qa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ra(m),i>1&&pa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ta(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ea.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ga(f):f}return h=ea.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=va(b[c]),f[u]?d.push(f):e.push(f);f=A(a,wa(e,d)),f.selector=a}return f},i=ea.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(!(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0]))return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&na(b.parentNode)||b))){if(j.splice(i,1),!(a=f.length&&pa(j)))return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&na(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ha(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ha(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ia("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ha(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ia("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ha(function(a){return null==a.getAttribute("disabled")})||ia(K,function(a,b,c){var d;if(!c)return!0===a[b]?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ea}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;b1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(!(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a))||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}if((f=d.getElementById(e[2]))&&f.parentNode){if(f.id!==e[2])return A.find(a);this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))}).prototype=n.fn,A=n(d);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;b-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function E(a,b){do{a=a[b]}while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return E(a,"nextSibling")},prev:function(a){return E(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(D[a]||(e=n.uniqueSort(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g;function G(a){var b={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);b0||(H.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function I(){d.addEventListener?(d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J)):(d.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(d.addEventListener||"load"===a.event.type||"complete"===d.readyState)&&(I(),n.ready())}n.ready.promise=function(b){if(!H)if(H=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll)a.setTimeout(n.ready);else if(d.addEventListener)d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J);else{d.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&function b(){if(!n.isReady){try{c.doScroll("left")}catch(e){return a.setTimeout(b,50)}I(),n.ready()}}()}return H.promise(b)},n.ready.promise();var K;for(K in n(l))break;l.ownFirst="0"===K,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;(c=d.getElementsByTagName("body")[0])&&c.style&&(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),void 0!==b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement("div");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var L=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return(1===c||9===c)&&(!b||!0!==b&&a.getAttribute("classid")===b)},M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if("string"==typeof(c=a.getAttribute(d))){try{c="true"===c||"false"!==c&&("null"===c?null:+c+""===c?+c:M.test(c)?n.parseJSON(c):c)}catch(e){}n.data(a,b,c)}else c=void 0}return c}function P(a){var b
;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(L(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),"object"!=typeof b&&"function"!=typeof b||(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?null==(f=g[b])&&(f=g[n.camelCase(b)]):f=g,f}}function R(a,b,c){if(L(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return!!(a=a.nodeType?n.cache[a[n.expando]]:a[n.expando])&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),O(f,d,e[d])));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?O(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengtha",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName("tbody").length,l.htmlSerialize=!!a.getElementsByTagName("link").length,l.html5Clone="<:nav>"!==d.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML="",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var ca={option:[1,""],legend:[1,""],area:[1,""],param:[1,""],thead:[1,""],tr:[2,""],col:[2,""],td:[3,""],_default:l.htmlSerialize?[0,"",""]:[1,"X","
"]};ca.optgroup=ca.option,ca.tbody=ca.tfoot=ca.colgroup=ca.caption=ca.thead,ca.th=ca.td;function da(a,b){var c,d,e=0,f=void 0!==a.getElementsByTagName?a.getElementsByTagName(b||"*"):void 0!==a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,da(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function ea(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}var fa=/<|?\w+;/,ga=/"!==m[1]||ga.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--)n.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k)}n.merge(q,i.childNodes),i.textContent="";while(i.firstChild)i.removeChild(i.firstChild);i=p.lastChild}else q.push(b.createTextNode(g));i&&p.removeChild(i),l.appendChecked||n.grep(da(q,"input"),ha),r=0;while(g=q[r++])if(d&&n.inArray(g,d)>-1)e&&e.push(g);else if(h=n.contains(g.ownerDocument,g),i=da(p.appendChild(g),"script"),h&&ea(i),c){f=0;while(g=i[f++])$.test(g.type||"")&&c.push(g)}return i=null,p}!function(){var b,c,e=d.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b]=c in a)||(e.setAttribute(c,"t"),l[b]=!1===e.attributes[c].expando);e=null}();var ja=/^(?:input|select|textarea)$/i,ka=/^key/,la=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ma=/^(?:focusinfocus|focusoutblur)$/,na=/^([^.]*)(?:\.(.+)|)/;function oa(){return!0}function pa(){return!1}function qa(){try{return d.activeElement}catch(a){}}function ra(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ra(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),!1===e)e=pa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return void 0===n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=na.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&!1!==j.setup.call(a,d,p,k)||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=na.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&!1!==l.teardown.call(a,p,r.handle)||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!ma.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),h=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||!1!==l.trigger.apply(e,c))){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,ma.test(j+q)||(i=i.parentNode);i;i=i.parentNode)p.push(i),m=i;m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped())b.type=o>1?j:l.bindType||q,g=(n._data(i,"events")||{})[b.type]&&n._data(i,"handle"),g&&g.apply(i,c),(g=h&&i[h])&&g.apply&&L(i)&&(b.result=g.apply(i,c),!1===b.result&&b.preventDefault());if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||!1===l._default.apply(p.pop(),c))&&L(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||!1!==k.preDispatch.call(this,a)){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,void 0!==(d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i))&&!1===(a.result=d)&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(!0!==i.disabled||"click"!==a.type)){for(d=[],c=0;c-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]","i"),ua=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,va=/